/*****************************************************************************
 *
 *                      HUSONG PROPRIETARY INFORMATION
 *
 *          The information contained herein is proprietary to HUSONG
 *           and shall not be reproduced or disclosed in whole or in part
 *                    or used for any design or manufacture
 *              without direct written authorization from HUSONG.
 *
 *            Copyright (c) 2015 by HUSONG.  All rights reserved.
 *
 *****************************************************************************/
package me.send.broker.mapper;

import java.util.List;
import java.util.Map;

import me.send.broker.pojo.BrokerEvaluateBean;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * @author maxmin
 *
 * @date 2015年8月25日 下午4:55:47
 */
public interface BrokerEvaluateMapper {
	
	@Select(value = "SELECT be.content,be.createtime,be.evaluate_id,be.point,u.nickname FROM broker_evaluate be "
			+ "LEFT JOIN `user` u ON be.userid = u.userid "
			+ "LEFT JOIN orders o ON o.orderid = be.orderid "
			+ "LEFT JOIN orderbroker ob ON ob.order_id = o.orderid "
			+ "WHERE ob.broker_id =#{brokerid} AND ob.ischecked = 1 "
			+ "AND IF(#{startId}>0,be.evaluate_id<#{startId},1=1) ORDER BY be.evaluate_id DESC LIMIT #{size}")
	@Results({
		@Result(column="evaluate_id",property="evaluateid")
	})
	public List<BrokerEvaluateBean> evaluateMe(Map<String, Object> params);
}
